// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace Elastic.Clients.Elasticsearch.Serverless.TransformManagement;

public partial class TransformManagementNamespacedClient : NamespacedClientProxy
{
	/// <summary>
	/// <para>
	/// Initializes a new instance of the <see cref="TransformManagementNamespacedClient"/> class for mocking.
	/// </para>
	/// </summary>
	protected TransformManagementNamespacedClient() : base()
	{
	}

	internal TransformManagementNamespacedClient(ElasticsearchClient client) : base(client)
	{
	}

	/// <summary>
	/// <para>
	/// Delete a transform.
	/// Deletes a transform.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteTransformResponse> DeleteTransformAsync(DeleteTransformRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<DeleteTransformRequest, DeleteTransformResponse, DeleteTransformRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Delete a transform.
	/// Deletes a transform.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteTransformResponse> DeleteTransformAsync(DeleteTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteTransformRequestDescriptor, DeleteTransformResponse, DeleteTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Delete a transform.
	/// Deletes a transform.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteTransformResponse> DeleteTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, CancellationToken cancellationToken = default)
	{
		var descriptor = new DeleteTransformRequestDescriptor(transformId);
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteTransformRequestDescriptor, DeleteTransformResponse, DeleteTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Delete a transform.
	/// Deletes a transform.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteTransformResponse> DeleteTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, Action<DeleteTransformRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new DeleteTransformRequestDescriptor(transformId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteTransformRequestDescriptor, DeleteTransformResponse, DeleteTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get transforms.
	/// Retrieves configuration information for transforms.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetTransformResponse> GetTransformAsync(GetTransformRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<GetTransformRequest, GetTransformResponse, GetTransformRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get transforms.
	/// Retrieves configuration information for transforms.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetTransformResponse> GetTransformAsync(GetTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GetTransformRequestDescriptor, GetTransformResponse, GetTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get transforms.
	/// Retrieves configuration information for transforms.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetTransformResponse> GetTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Names? transformId, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetTransformRequestDescriptor(transformId);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetTransformRequestDescriptor, GetTransformResponse, GetTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get transforms.
	/// Retrieves configuration information for transforms.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetTransformResponse> GetTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Names? transformId, Action<GetTransformRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetTransformRequestDescriptor(transformId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetTransformRequestDescriptor, GetTransformResponse, GetTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get transforms.
	/// Retrieves configuration information for transforms.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetTransformResponse> GetTransformAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new GetTransformRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<GetTransformRequestDescriptor, GetTransformResponse, GetTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get transforms.
	/// Retrieves configuration information for transforms.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetTransformResponse> GetTransformAsync(Action<GetTransformRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetTransformRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetTransformRequestDescriptor, GetTransformResponse, GetTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get transform stats.
	/// Retrieves usage information for transforms.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetTransformStatsResponse> GetTransformStatsAsync(GetTransformStatsRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<GetTransformStatsRequest, GetTransformStatsResponse, GetTransformStatsRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get transform stats.
	/// Retrieves usage information for transforms.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetTransformStatsResponse> GetTransformStatsAsync(GetTransformStatsRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GetTransformStatsRequestDescriptor, GetTransformStatsResponse, GetTransformStatsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get transform stats.
	/// Retrieves usage information for transforms.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetTransformStatsResponse> GetTransformStatsAsync(Elastic.Clients.Elasticsearch.Serverless.Names transformId, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetTransformStatsRequestDescriptor(transformId);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetTransformStatsRequestDescriptor, GetTransformStatsResponse, GetTransformStatsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get transform stats.
	/// Retrieves usage information for transforms.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetTransformStatsResponse> GetTransformStatsAsync(Elastic.Clients.Elasticsearch.Serverless.Names transformId, Action<GetTransformStatsRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetTransformStatsRequestDescriptor(transformId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetTransformStatsRequestDescriptor, GetTransformStatsResponse, GetTransformStatsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Preview a transform.
	/// Generates a preview of the results that you will get when you create a transform with the same configuration.
	/// </para>
	/// <para>
	/// It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also
	/// generates a list of mappings and settings for the destination index. These values are determined based on the field
	/// types of the source index and the transform aggregations.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PreviewTransformResponse<TTransform>> PreviewTransformAsync<TTransform>(PreviewTransformRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<PreviewTransformRequest, PreviewTransformResponse<TTransform>, PreviewTransformRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Preview a transform.
	/// Generates a preview of the results that you will get when you create a transform with the same configuration.
	/// </para>
	/// <para>
	/// It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also
	/// generates a list of mappings and settings for the destination index. These values are determined based on the field
	/// types of the source index and the transform aggregations.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PreviewTransformResponse<TTransform>> PreviewTransformAsync<TTransform>(PreviewTransformRequestDescriptor<TTransform> descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<PreviewTransformRequestDescriptor<TTransform>, PreviewTransformResponse<TTransform>, PreviewTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Preview a transform.
	/// Generates a preview of the results that you will get when you create a transform with the same configuration.
	/// </para>
	/// <para>
	/// It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also
	/// generates a list of mappings and settings for the destination index. These values are determined based on the field
	/// types of the source index and the transform aggregations.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PreviewTransformResponse<TTransform>> PreviewTransformAsync<TTransform>(Elastic.Clients.Elasticsearch.Serverless.Id? transformId, CancellationToken cancellationToken = default)
	{
		var descriptor = new PreviewTransformRequestDescriptor<TTransform>(transformId);
		descriptor.BeforeRequest();
		return DoRequestAsync<PreviewTransformRequestDescriptor<TTransform>, PreviewTransformResponse<TTransform>, PreviewTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Preview a transform.
	/// Generates a preview of the results that you will get when you create a transform with the same configuration.
	/// </para>
	/// <para>
	/// It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also
	/// generates a list of mappings and settings for the destination index. These values are determined based on the field
	/// types of the source index and the transform aggregations.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PreviewTransformResponse<TTransform>> PreviewTransformAsync<TTransform>(Elastic.Clients.Elasticsearch.Serverless.Id? transformId, Action<PreviewTransformRequestDescriptor<TTransform>> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new PreviewTransformRequestDescriptor<TTransform>(transformId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<PreviewTransformRequestDescriptor<TTransform>, PreviewTransformResponse<TTransform>, PreviewTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Preview a transform.
	/// Generates a preview of the results that you will get when you create a transform with the same configuration.
	/// </para>
	/// <para>
	/// It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also
	/// generates a list of mappings and settings for the destination index. These values are determined based on the field
	/// types of the source index and the transform aggregations.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PreviewTransformResponse<TTransform>> PreviewTransformAsync<TTransform>(CancellationToken cancellationToken = default)
	{
		var descriptor = new PreviewTransformRequestDescriptor<TTransform>();
		descriptor.BeforeRequest();
		return DoRequestAsync<PreviewTransformRequestDescriptor<TTransform>, PreviewTransformResponse<TTransform>, PreviewTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Preview a transform.
	/// Generates a preview of the results that you will get when you create a transform with the same configuration.
	/// </para>
	/// <para>
	/// It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also
	/// generates a list of mappings and settings for the destination index. These values are determined based on the field
	/// types of the source index and the transform aggregations.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PreviewTransformResponse<TTransform>> PreviewTransformAsync<TTransform>(Action<PreviewTransformRequestDescriptor<TTransform>> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new PreviewTransformRequestDescriptor<TTransform>();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<PreviewTransformRequestDescriptor<TTransform>, PreviewTransformResponse<TTransform>, PreviewTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Create a transform.
	/// Creates a transform.
	/// </para>
	/// <para>
	/// A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as
	/// a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a
	/// unique row per entity.
	/// </para>
	/// <para>
	/// You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If
	/// you choose to use the pivot method for your transform, the entities are defined by the set of <c>group_by</c> fields in
	/// the pivot object. If you choose to use the latest method, the entities are defined by the <c>unique_key</c> field values
	/// in the latest object.
	/// </para>
	/// <para>
	/// You must have <c>create_index</c>, <c>index</c>, and <c>read</c> privileges on the destination index and <c>read</c> and
	/// <c>view_index_metadata</c> privileges on the source indices. When Elasticsearch security features are enabled, the
	/// transform remembers which roles the user that created it had at the time of creation and uses those same roles. If
	/// those roles do not have the required privileges on the source and destination indices, the transform fails when it
	/// attempts unauthorized operations.
	/// </para>
	/// <para>
	/// NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
	/// <c>.transform-internal*</c> indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do
	/// not give users any privileges on <c>.transform-internal*</c> indices. If you used transforms prior to 7.5, also do not
	/// give users any privileges on <c>.data-frame-internal*</c> indices.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutTransformResponse> PutTransformAsync(PutTransformRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<PutTransformRequest, PutTransformResponse, PutTransformRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Create a transform.
	/// Creates a transform.
	/// </para>
	/// <para>
	/// A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as
	/// a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a
	/// unique row per entity.
	/// </para>
	/// <para>
	/// You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If
	/// you choose to use the pivot method for your transform, the entities are defined by the set of <c>group_by</c> fields in
	/// the pivot object. If you choose to use the latest method, the entities are defined by the <c>unique_key</c> field values
	/// in the latest object.
	/// </para>
	/// <para>
	/// You must have <c>create_index</c>, <c>index</c>, and <c>read</c> privileges on the destination index and <c>read</c> and
	/// <c>view_index_metadata</c> privileges on the source indices. When Elasticsearch security features are enabled, the
	/// transform remembers which roles the user that created it had at the time of creation and uses those same roles. If
	/// those roles do not have the required privileges on the source and destination indices, the transform fails when it
	/// attempts unauthorized operations.
	/// </para>
	/// <para>
	/// NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
	/// <c>.transform-internal*</c> indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do
	/// not give users any privileges on <c>.transform-internal*</c> indices. If you used transforms prior to 7.5, also do not
	/// give users any privileges on <c>.data-frame-internal*</c> indices.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutTransformResponse> PutTransformAsync<TDocument>(PutTransformRequestDescriptor<TDocument> descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<PutTransformRequestDescriptor<TDocument>, PutTransformResponse, PutTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Create a transform.
	/// Creates a transform.
	/// </para>
	/// <para>
	/// A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as
	/// a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a
	/// unique row per entity.
	/// </para>
	/// <para>
	/// You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If
	/// you choose to use the pivot method for your transform, the entities are defined by the set of <c>group_by</c> fields in
	/// the pivot object. If you choose to use the latest method, the entities are defined by the <c>unique_key</c> field values
	/// in the latest object.
	/// </para>
	/// <para>
	/// You must have <c>create_index</c>, <c>index</c>, and <c>read</c> privileges on the destination index and <c>read</c> and
	/// <c>view_index_metadata</c> privileges on the source indices. When Elasticsearch security features are enabled, the
	/// transform remembers which roles the user that created it had at the time of creation and uses those same roles. If
	/// those roles do not have the required privileges on the source and destination indices, the transform fails when it
	/// attempts unauthorized operations.
	/// </para>
	/// <para>
	/// NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
	/// <c>.transform-internal*</c> indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do
	/// not give users any privileges on <c>.transform-internal*</c> indices. If you used transforms prior to 7.5, also do not
	/// give users any privileges on <c>.data-frame-internal*</c> indices.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutTransformResponse> PutTransformAsync<TDocument>(Elastic.Clients.Elasticsearch.Serverless.Id transformId, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutTransformRequestDescriptor<TDocument>(transformId);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutTransformRequestDescriptor<TDocument>, PutTransformResponse, PutTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Create a transform.
	/// Creates a transform.
	/// </para>
	/// <para>
	/// A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as
	/// a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a
	/// unique row per entity.
	/// </para>
	/// <para>
	/// You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If
	/// you choose to use the pivot method for your transform, the entities are defined by the set of <c>group_by</c> fields in
	/// the pivot object. If you choose to use the latest method, the entities are defined by the <c>unique_key</c> field values
	/// in the latest object.
	/// </para>
	/// <para>
	/// You must have <c>create_index</c>, <c>index</c>, and <c>read</c> privileges on the destination index and <c>read</c> and
	/// <c>view_index_metadata</c> privileges on the source indices. When Elasticsearch security features are enabled, the
	/// transform remembers which roles the user that created it had at the time of creation and uses those same roles. If
	/// those roles do not have the required privileges on the source and destination indices, the transform fails when it
	/// attempts unauthorized operations.
	/// </para>
	/// <para>
	/// NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
	/// <c>.transform-internal*</c> indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do
	/// not give users any privileges on <c>.transform-internal*</c> indices. If you used transforms prior to 7.5, also do not
	/// give users any privileges on <c>.data-frame-internal*</c> indices.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutTransformResponse> PutTransformAsync<TDocument>(Elastic.Clients.Elasticsearch.Serverless.Id transformId, Action<PutTransformRequestDescriptor<TDocument>> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutTransformRequestDescriptor<TDocument>(transformId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutTransformRequestDescriptor<TDocument>, PutTransformResponse, PutTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Create a transform.
	/// Creates a transform.
	/// </para>
	/// <para>
	/// A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as
	/// a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a
	/// unique row per entity.
	/// </para>
	/// <para>
	/// You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If
	/// you choose to use the pivot method for your transform, the entities are defined by the set of <c>group_by</c> fields in
	/// the pivot object. If you choose to use the latest method, the entities are defined by the <c>unique_key</c> field values
	/// in the latest object.
	/// </para>
	/// <para>
	/// You must have <c>create_index</c>, <c>index</c>, and <c>read</c> privileges on the destination index and <c>read</c> and
	/// <c>view_index_metadata</c> privileges on the source indices. When Elasticsearch security features are enabled, the
	/// transform remembers which roles the user that created it had at the time of creation and uses those same roles. If
	/// those roles do not have the required privileges on the source and destination indices, the transform fails when it
	/// attempts unauthorized operations.
	/// </para>
	/// <para>
	/// NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
	/// <c>.transform-internal*</c> indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do
	/// not give users any privileges on <c>.transform-internal*</c> indices. If you used transforms prior to 7.5, also do not
	/// give users any privileges on <c>.data-frame-internal*</c> indices.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutTransformResponse> PutTransformAsync(PutTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<PutTransformRequestDescriptor, PutTransformResponse, PutTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Create a transform.
	/// Creates a transform.
	/// </para>
	/// <para>
	/// A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as
	/// a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a
	/// unique row per entity.
	/// </para>
	/// <para>
	/// You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If
	/// you choose to use the pivot method for your transform, the entities are defined by the set of <c>group_by</c> fields in
	/// the pivot object. If you choose to use the latest method, the entities are defined by the <c>unique_key</c> field values
	/// in the latest object.
	/// </para>
	/// <para>
	/// You must have <c>create_index</c>, <c>index</c>, and <c>read</c> privileges on the destination index and <c>read</c> and
	/// <c>view_index_metadata</c> privileges on the source indices. When Elasticsearch security features are enabled, the
	/// transform remembers which roles the user that created it had at the time of creation and uses those same roles. If
	/// those roles do not have the required privileges on the source and destination indices, the transform fails when it
	/// attempts unauthorized operations.
	/// </para>
	/// <para>
	/// NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
	/// <c>.transform-internal*</c> indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do
	/// not give users any privileges on <c>.transform-internal*</c> indices. If you used transforms prior to 7.5, also do not
	/// give users any privileges on <c>.data-frame-internal*</c> indices.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutTransformResponse> PutTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutTransformRequestDescriptor(transformId);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutTransformRequestDescriptor, PutTransformResponse, PutTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Create a transform.
	/// Creates a transform.
	/// </para>
	/// <para>
	/// A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as
	/// a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a
	/// unique row per entity.
	/// </para>
	/// <para>
	/// You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If
	/// you choose to use the pivot method for your transform, the entities are defined by the set of <c>group_by</c> fields in
	/// the pivot object. If you choose to use the latest method, the entities are defined by the <c>unique_key</c> field values
	/// in the latest object.
	/// </para>
	/// <para>
	/// You must have <c>create_index</c>, <c>index</c>, and <c>read</c> privileges on the destination index and <c>read</c> and
	/// <c>view_index_metadata</c> privileges on the source indices. When Elasticsearch security features are enabled, the
	/// transform remembers which roles the user that created it had at the time of creation and uses those same roles. If
	/// those roles do not have the required privileges on the source and destination indices, the transform fails when it
	/// attempts unauthorized operations.
	/// </para>
	/// <para>
	/// NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
	/// <c>.transform-internal*</c> indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do
	/// not give users any privileges on <c>.transform-internal*</c> indices. If you used transforms prior to 7.5, also do not
	/// give users any privileges on <c>.data-frame-internal*</c> indices.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutTransformResponse> PutTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, Action<PutTransformRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutTransformRequestDescriptor(transformId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutTransformRequestDescriptor, PutTransformResponse, PutTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Reset a transform.
	/// Resets a transform.
	/// Before you can reset it, you must stop it; alternatively, use the <c>force</c> query parameter.
	/// If the destination index was created by the transform, it is deleted.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ResetTransformResponse> ResetTransformAsync(ResetTransformRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<ResetTransformRequest, ResetTransformResponse, ResetTransformRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Reset a transform.
	/// Resets a transform.
	/// Before you can reset it, you must stop it; alternatively, use the <c>force</c> query parameter.
	/// If the destination index was created by the transform, it is deleted.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ResetTransformResponse> ResetTransformAsync(ResetTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<ResetTransformRequestDescriptor, ResetTransformResponse, ResetTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Reset a transform.
	/// Resets a transform.
	/// Before you can reset it, you must stop it; alternatively, use the <c>force</c> query parameter.
	/// If the destination index was created by the transform, it is deleted.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ResetTransformResponse> ResetTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, CancellationToken cancellationToken = default)
	{
		var descriptor = new ResetTransformRequestDescriptor(transformId);
		descriptor.BeforeRequest();
		return DoRequestAsync<ResetTransformRequestDescriptor, ResetTransformResponse, ResetTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Reset a transform.
	/// Resets a transform.
	/// Before you can reset it, you must stop it; alternatively, use the <c>force</c> query parameter.
	/// If the destination index was created by the transform, it is deleted.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ResetTransformResponse> ResetTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, Action<ResetTransformRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new ResetTransformRequestDescriptor(transformId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<ResetTransformRequestDescriptor, ResetTransformResponse, ResetTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Schedule a transform to start now.
	/// Instantly runs a transform to process data.
	/// </para>
	/// <para>
	/// If you _schedule_now a transform, it will process the new data instantly,
	/// without waiting for the configured frequency interval. After _schedule_now API is called,
	/// the transform will be processed again at now + frequency unless _schedule_now API
	/// is called again in the meantime.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/schedule-now-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ScheduleNowTransformResponse> ScheduleNowTransformAsync(ScheduleNowTransformRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<ScheduleNowTransformRequest, ScheduleNowTransformResponse, ScheduleNowTransformRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Schedule a transform to start now.
	/// Instantly runs a transform to process data.
	/// </para>
	/// <para>
	/// If you _schedule_now a transform, it will process the new data instantly,
	/// without waiting for the configured frequency interval. After _schedule_now API is called,
	/// the transform will be processed again at now + frequency unless _schedule_now API
	/// is called again in the meantime.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/schedule-now-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ScheduleNowTransformResponse> ScheduleNowTransformAsync(ScheduleNowTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<ScheduleNowTransformRequestDescriptor, ScheduleNowTransformResponse, ScheduleNowTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Schedule a transform to start now.
	/// Instantly runs a transform to process data.
	/// </para>
	/// <para>
	/// If you _schedule_now a transform, it will process the new data instantly,
	/// without waiting for the configured frequency interval. After _schedule_now API is called,
	/// the transform will be processed again at now + frequency unless _schedule_now API
	/// is called again in the meantime.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/schedule-now-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ScheduleNowTransformResponse> ScheduleNowTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, CancellationToken cancellationToken = default)
	{
		var descriptor = new ScheduleNowTransformRequestDescriptor(transformId);
		descriptor.BeforeRequest();
		return DoRequestAsync<ScheduleNowTransformRequestDescriptor, ScheduleNowTransformResponse, ScheduleNowTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Schedule a transform to start now.
	/// Instantly runs a transform to process data.
	/// </para>
	/// <para>
	/// If you _schedule_now a transform, it will process the new data instantly,
	/// without waiting for the configured frequency interval. After _schedule_now API is called,
	/// the transform will be processed again at now + frequency unless _schedule_now API
	/// is called again in the meantime.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/schedule-now-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ScheduleNowTransformResponse> ScheduleNowTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, Action<ScheduleNowTransformRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new ScheduleNowTransformRequestDescriptor(transformId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<ScheduleNowTransformRequestDescriptor, ScheduleNowTransformResponse, ScheduleNowTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Start a transform.
	/// Starts a transform.
	/// </para>
	/// <para>
	/// When you start a transform, it creates the destination index if it does not already exist. The <c>number_of_shards</c> is
	/// set to <c>1</c> and the <c>auto_expand_replicas</c> is set to <c>0-1</c>. If it is a pivot transform, it deduces the mapping
	/// definitions for the destination index from the source indices and the transform aggregations. If fields in the
	/// destination index are derived from scripts (as in the case of <c>scripted_metric</c> or <c>bucket_script</c> aggregations),
	/// the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce
	/// mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you
	/// start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings
	/// in a pivot transform.
	/// </para>
	/// <para>
	/// When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you
	/// created the transform, they occur when you start the transform—​with the exception of privilege checks. When
	/// Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the
	/// time of creation and uses those same roles. If those roles do not have the required privileges on the source and
	/// destination indices, the transform fails when it attempts unauthorized operations.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<StartTransformResponse> StartTransformAsync(StartTransformRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<StartTransformRequest, StartTransformResponse, StartTransformRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Start a transform.
	/// Starts a transform.
	/// </para>
	/// <para>
	/// When you start a transform, it creates the destination index if it does not already exist. The <c>number_of_shards</c> is
	/// set to <c>1</c> and the <c>auto_expand_replicas</c> is set to <c>0-1</c>. If it is a pivot transform, it deduces the mapping
	/// definitions for the destination index from the source indices and the transform aggregations. If fields in the
	/// destination index are derived from scripts (as in the case of <c>scripted_metric</c> or <c>bucket_script</c> aggregations),
	/// the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce
	/// mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you
	/// start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings
	/// in a pivot transform.
	/// </para>
	/// <para>
	/// When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you
	/// created the transform, they occur when you start the transform—​with the exception of privilege checks. When
	/// Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the
	/// time of creation and uses those same roles. If those roles do not have the required privileges on the source and
	/// destination indices, the transform fails when it attempts unauthorized operations.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<StartTransformResponse> StartTransformAsync(StartTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<StartTransformRequestDescriptor, StartTransformResponse, StartTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Start a transform.
	/// Starts a transform.
	/// </para>
	/// <para>
	/// When you start a transform, it creates the destination index if it does not already exist. The <c>number_of_shards</c> is
	/// set to <c>1</c> and the <c>auto_expand_replicas</c> is set to <c>0-1</c>. If it is a pivot transform, it deduces the mapping
	/// definitions for the destination index from the source indices and the transform aggregations. If fields in the
	/// destination index are derived from scripts (as in the case of <c>scripted_metric</c> or <c>bucket_script</c> aggregations),
	/// the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce
	/// mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you
	/// start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings
	/// in a pivot transform.
	/// </para>
	/// <para>
	/// When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you
	/// created the transform, they occur when you start the transform—​with the exception of privilege checks. When
	/// Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the
	/// time of creation and uses those same roles. If those roles do not have the required privileges on the source and
	/// destination indices, the transform fails when it attempts unauthorized operations.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<StartTransformResponse> StartTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, CancellationToken cancellationToken = default)
	{
		var descriptor = new StartTransformRequestDescriptor(transformId);
		descriptor.BeforeRequest();
		return DoRequestAsync<StartTransformRequestDescriptor, StartTransformResponse, StartTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Start a transform.
	/// Starts a transform.
	/// </para>
	/// <para>
	/// When you start a transform, it creates the destination index if it does not already exist. The <c>number_of_shards</c> is
	/// set to <c>1</c> and the <c>auto_expand_replicas</c> is set to <c>0-1</c>. If it is a pivot transform, it deduces the mapping
	/// definitions for the destination index from the source indices and the transform aggregations. If fields in the
	/// destination index are derived from scripts (as in the case of <c>scripted_metric</c> or <c>bucket_script</c> aggregations),
	/// the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce
	/// mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you
	/// start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings
	/// in a pivot transform.
	/// </para>
	/// <para>
	/// When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you
	/// created the transform, they occur when you start the transform—​with the exception of privilege checks. When
	/// Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the
	/// time of creation and uses those same roles. If those roles do not have the required privileges on the source and
	/// destination indices, the transform fails when it attempts unauthorized operations.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<StartTransformResponse> StartTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, Action<StartTransformRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new StartTransformRequestDescriptor(transformId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<StartTransformRequestDescriptor, StartTransformResponse, StartTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Stop transforms.
	/// Stops one or more transforms.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<StopTransformResponse> StopTransformAsync(StopTransformRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<StopTransformRequest, StopTransformResponse, StopTransformRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Stop transforms.
	/// Stops one or more transforms.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<StopTransformResponse> StopTransformAsync(StopTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<StopTransformRequestDescriptor, StopTransformResponse, StopTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Stop transforms.
	/// Stops one or more transforms.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<StopTransformResponse> StopTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Name transformId, CancellationToken cancellationToken = default)
	{
		var descriptor = new StopTransformRequestDescriptor(transformId);
		descriptor.BeforeRequest();
		return DoRequestAsync<StopTransformRequestDescriptor, StopTransformResponse, StopTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Stop transforms.
	/// Stops one or more transforms.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<StopTransformResponse> StopTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Name transformId, Action<StopTransformRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new StopTransformRequestDescriptor(transformId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<StopTransformRequestDescriptor, StopTransformResponse, StopTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Update a transform.
	/// Updates certain properties of a transform.
	/// </para>
	/// <para>
	/// All updated properties except <c>description</c> do not take effect until after the transform starts the next checkpoint,
	/// thus there is data consistency in each checkpoint. To use this API, you must have <c>read</c> and <c>view_index_metadata</c>
	/// privileges for the source indices. You must also have <c>index</c> and <c>read</c> privileges for the destination index. When
	/// Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the
	/// time of update and runs with those privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateTransformResponse> UpdateTransformAsync(UpdateTransformRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<UpdateTransformRequest, UpdateTransformResponse, UpdateTransformRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Update a transform.
	/// Updates certain properties of a transform.
	/// </para>
	/// <para>
	/// All updated properties except <c>description</c> do not take effect until after the transform starts the next checkpoint,
	/// thus there is data consistency in each checkpoint. To use this API, you must have <c>read</c> and <c>view_index_metadata</c>
	/// privileges for the source indices. You must also have <c>index</c> and <c>read</c> privileges for the destination index. When
	/// Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the
	/// time of update and runs with those privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateTransformResponse> UpdateTransformAsync<TDocument>(UpdateTransformRequestDescriptor<TDocument> descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<UpdateTransformRequestDescriptor<TDocument>, UpdateTransformResponse, UpdateTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Update a transform.
	/// Updates certain properties of a transform.
	/// </para>
	/// <para>
	/// All updated properties except <c>description</c> do not take effect until after the transform starts the next checkpoint,
	/// thus there is data consistency in each checkpoint. To use this API, you must have <c>read</c> and <c>view_index_metadata</c>
	/// privileges for the source indices. You must also have <c>index</c> and <c>read</c> privileges for the destination index. When
	/// Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the
	/// time of update and runs with those privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateTransformResponse> UpdateTransformAsync<TDocument>(Elastic.Clients.Elasticsearch.Serverless.Id transformId, CancellationToken cancellationToken = default)
	{
		var descriptor = new UpdateTransformRequestDescriptor<TDocument>(transformId);
		descriptor.BeforeRequest();
		return DoRequestAsync<UpdateTransformRequestDescriptor<TDocument>, UpdateTransformResponse, UpdateTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Update a transform.
	/// Updates certain properties of a transform.
	/// </para>
	/// <para>
	/// All updated properties except <c>description</c> do not take effect until after the transform starts the next checkpoint,
	/// thus there is data consistency in each checkpoint. To use this API, you must have <c>read</c> and <c>view_index_metadata</c>
	/// privileges for the source indices. You must also have <c>index</c> and <c>read</c> privileges for the destination index. When
	/// Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the
	/// time of update and runs with those privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateTransformResponse> UpdateTransformAsync<TDocument>(Elastic.Clients.Elasticsearch.Serverless.Id transformId, Action<UpdateTransformRequestDescriptor<TDocument>> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new UpdateTransformRequestDescriptor<TDocument>(transformId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<UpdateTransformRequestDescriptor<TDocument>, UpdateTransformResponse, UpdateTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Update a transform.
	/// Updates certain properties of a transform.
	/// </para>
	/// <para>
	/// All updated properties except <c>description</c> do not take effect until after the transform starts the next checkpoint,
	/// thus there is data consistency in each checkpoint. To use this API, you must have <c>read</c> and <c>view_index_metadata</c>
	/// privileges for the source indices. You must also have <c>index</c> and <c>read</c> privileges for the destination index. When
	/// Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the
	/// time of update and runs with those privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateTransformResponse> UpdateTransformAsync(UpdateTransformRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<UpdateTransformRequestDescriptor, UpdateTransformResponse, UpdateTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Update a transform.
	/// Updates certain properties of a transform.
	/// </para>
	/// <para>
	/// All updated properties except <c>description</c> do not take effect until after the transform starts the next checkpoint,
	/// thus there is data consistency in each checkpoint. To use this API, you must have <c>read</c> and <c>view_index_metadata</c>
	/// privileges for the source indices. You must also have <c>index</c> and <c>read</c> privileges for the destination index. When
	/// Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the
	/// time of update and runs with those privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateTransformResponse> UpdateTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, CancellationToken cancellationToken = default)
	{
		var descriptor = new UpdateTransformRequestDescriptor(transformId);
		descriptor.BeforeRequest();
		return DoRequestAsync<UpdateTransformRequestDescriptor, UpdateTransformResponse, UpdateTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Update a transform.
	/// Updates certain properties of a transform.
	/// </para>
	/// <para>
	/// All updated properties except <c>description</c> do not take effect until after the transform starts the next checkpoint,
	/// thus there is data consistency in each checkpoint. To use this API, you must have <c>read</c> and <c>view_index_metadata</c>
	/// privileges for the source indices. You must also have <c>index</c> and <c>read</c> privileges for the destination index. When
	/// Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the
	/// time of update and runs with those privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateTransformResponse> UpdateTransformAsync(Elastic.Clients.Elasticsearch.Serverless.Id transformId, Action<UpdateTransformRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new UpdateTransformRequestDescriptor(transformId);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<UpdateTransformRequestDescriptor, UpdateTransformResponse, UpdateTransformRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Upgrades all transforms.
	/// This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. It
	/// also cleans up the internal data structures that store the transform state and checkpoints. The upgrade does not
	/// affect the source and destination indices. The upgrade also does not affect the roles that transforms use when
	/// Elasticsearch security features are enabled; the role used to read source data and write to the destination index
	/// remains unchanged.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/upgrade-transforms.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpgradeTransformsResponse> UpgradeTransformsAsync(UpgradeTransformsRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<UpgradeTransformsRequest, UpgradeTransformsResponse, UpgradeTransformsRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Upgrades all transforms.
	/// This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. It
	/// also cleans up the internal data structures that store the transform state and checkpoints. The upgrade does not
	/// affect the source and destination indices. The upgrade also does not affect the roles that transforms use when
	/// Elasticsearch security features are enabled; the role used to read source data and write to the destination index
	/// remains unchanged.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/upgrade-transforms.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpgradeTransformsResponse> UpgradeTransformsAsync(UpgradeTransformsRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<UpgradeTransformsRequestDescriptor, UpgradeTransformsResponse, UpgradeTransformsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Upgrades all transforms.
	/// This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. It
	/// also cleans up the internal data structures that store the transform state and checkpoints. The upgrade does not
	/// affect the source and destination indices. The upgrade also does not affect the roles that transforms use when
	/// Elasticsearch security features are enabled; the role used to read source data and write to the destination index
	/// remains unchanged.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/upgrade-transforms.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpgradeTransformsResponse> UpgradeTransformsAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new UpgradeTransformsRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<UpgradeTransformsRequestDescriptor, UpgradeTransformsResponse, UpgradeTransformsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Upgrades all transforms.
	/// This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. It
	/// also cleans up the internal data structures that store the transform state and checkpoints. The upgrade does not
	/// affect the source and destination indices. The upgrade also does not affect the roles that transforms use when
	/// Elasticsearch security features are enabled; the role used to read source data and write to the destination index
	/// remains unchanged.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/upgrade-transforms.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpgradeTransformsResponse> UpgradeTransformsAsync(Action<UpgradeTransformsRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new UpgradeTransformsRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<UpgradeTransformsRequestDescriptor, UpgradeTransformsResponse, UpgradeTransformsRequestParameters>(descriptor, cancellationToken);
	}
}